﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WhiteGloss.Models;

namespace WhiteGloss.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            WgArtists data = new WgArtists();
            HomePage model = new HomePage();
            model.Artists = (from a in data.Artists select a).ToList();
            
            return View(model);
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult Events()
        {
            return View();
        }

        public ActionResult Artist(int id)
        {
            WgArtists data = new WgArtists();
            ArtistPage model = new ArtistPage();
            model.Artist = (from a in data.Artists where a.ArtistId == id select a).Single();
            model.Images = (from i in data.Images where i.ArtistId == id select i).ToList();
            return View(model);
        }

        public ActionResult Images(int id)
        {
            WgArtists data = new WgArtists();
            ArtistPage model = new ArtistPage();
            model.Artist = (from a in data.Artists where a.ArtistId == id select a).Single();
            model.Images = (from i in data.Images where i.ArtistId == id select i).ToList();
            return View(model);
        }

        public ActionResult Bio(int id)
        {
            WgArtists data = new WgArtists();
            ArtistPage model = new ArtistPage();
            model.Artist = (from a in data.Artists where a.ArtistId == id select a).Single();
            model.Images = (from i in data.Images where i.ArtistId == id select i).ToList();
            return View(model);
        }
    }
}
